<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Qwt User&#39;s Guide: qwt_spline_curve_fitter.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Qwt User&#39;s Guide
   &#160;<span id="projectnumber">6.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('qwt__spline__curve__fitter_8cpp_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">qwt_spline_curve_fitter.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Qwt Widget Library</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Copyright (C) 1997   Josef Wilgen</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright (C) 2002   Uwe Rathmann</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * This library is free software; you can redistribute it and/or</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *****************************************************************************/</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &quot;qwt_spline_curve_fitter.h&quot;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;qwt_spline_local.h&quot;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;qwt_spline_parametrization.h&quot;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;qpolygon.h&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;qpainterpath.h&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160; </div>
<div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="class_qwt_spline_curve_fitter.html#a98ae80240b254df85dcc44e1f3e4e830">   18</a></span>&#160;<a class="code" href="class_qwt_spline_curve_fitter.html#a98ae80240b254df85dcc44e1f3e4e830">QwtSplineCurveFitter::QwtSplineCurveFitter</a>()</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    : <a class="code" href="class_qwt_curve_fitter.html">QwtCurveFitter</a>( <a class="code" href="class_qwt_curve_fitter.html">QwtCurveFitter</a>::Path )</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;{</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    m_spline = <span class="keyword">new</span> <a class="code" href="class_qwt_spline_local.html">QwtSplineLocal</a>( <a class="code" href="class_qwt_spline_local.html#a1b65106f91b7cdbc7a389f3389041407ad691c00c49d088f841cb3068ba960b41">QwtSplineLocal::Cardinal</a> );</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    m_spline-&gt;<a class="code" href="class_qwt_spline.html#afb4959b1db04dd021b0a49752b66fac3">setParametrization</a>( <a class="code" href="class_qwt_spline_parametrization.html#aa63256420483fa4981452127366cb48daa34d8f54e326e8964c6131287dd3e478">QwtSplineParametrization::ParameterUniform</a> );</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;}</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="class_qwt_spline_curve_fitter.html#a933ecbf859698978104d0dd4ec2a2f6a">   26</a></span>&#160;<a class="code" href="class_qwt_spline_curve_fitter.html#a933ecbf859698978104d0dd4ec2a2f6a">QwtSplineCurveFitter::~QwtSplineCurveFitter</a>()</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;{</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="keyword">delete</span> m_spline;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;}</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="class_qwt_spline_curve_fitter.html#a3366c97cd1b28bf962d4fdbf3d75d51a">   40</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_spline_curve_fitter.html#a3366c97cd1b28bf962d4fdbf3d75d51a">QwtSplineCurveFitter::setSpline</a>( <a class="code" href="class_qwt_spline.html">QwtSpline</a>* spline )</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;{</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordflow">if</span> ( m_spline == <a class="code" href="class_qwt_spline_curve_fitter.html#aab51a4d6d28eb87ffd0e2878c7c32a71">spline</a> )</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <span class="keyword">delete</span> m_spline;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    m_spline = <a class="code" href="class_qwt_spline_curve_fitter.html#aab51a4d6d28eb87ffd0e2878c7c32a71">spline</a>;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;}</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="class_qwt_spline_curve_fitter.html#aab51a4d6d28eb87ffd0e2878c7c32a71">   53</a></span>&#160;<span class="keyword">const</span> <a class="code" href="class_qwt_spline.html">QwtSpline</a>* <a class="code" href="class_qwt_spline_curve_fitter.html#aab51a4d6d28eb87ffd0e2878c7c32a71">QwtSplineCurveFitter::spline</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <span class="keywordflow">return</span> m_spline;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;}</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="class_qwt_spline_curve_fitter.html#a98ddae85cebabe91731ac63746cf3389">   62</a></span>&#160;<a class="code" href="class_qwt_spline.html">QwtSpline</a>* <a class="code" href="class_qwt_spline_curve_fitter.html#aab51a4d6d28eb87ffd0e2878c7c32a71">QwtSplineCurveFitter::spline</a>()</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;{</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordflow">return</span> m_spline;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;}</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="class_qwt_spline_curve_fitter.html#acec7ca66398cd0e6b6e24159e9f00d3b">   75</a></span>&#160;QPolygonF <a class="code" href="class_qwt_spline_curve_fitter.html#acec7ca66398cd0e6b6e24159e9f00d3b">QwtSplineCurveFitter::fitCurve</a>( <span class="keyword">const</span> QPolygonF&amp; points )<span class="keyword"> const</span></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keyword">const</span> QPainterPath path = <a class="code" href="class_qwt_spline_curve_fitter.html#a6d537e6d3aebdba0589eb2d1aa9c9154">fitCurvePath</a>( points );</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keyword">const</span> <a class="code" href="class_q_list.html">QList&lt; QPolygonF &gt;</a> subPaths = path.toSubpathPolygons();</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordflow">if</span> ( subPaths.size() == 1 )</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        subPaths.first();</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keywordflow">return</span> QPolygonF();</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;}</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="class_qwt_spline_curve_fitter.html#a6d537e6d3aebdba0589eb2d1aa9c9154">   94</a></span>&#160;QPainterPath <a class="code" href="class_qwt_spline_curve_fitter.html#a6d537e6d3aebdba0589eb2d1aa9c9154">QwtSplineCurveFitter::fitCurvePath</a>( <span class="keyword">const</span> QPolygonF&amp; points )<span class="keyword"> const</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    QPainterPath path;</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160; </div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keywordflow">if</span> ( m_spline )</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        path = m_spline-&gt;<a class="code" href="class_qwt_spline.html#a34c5ddda039f15ec71de0523d9753b64">painterPath</a>( points );</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; </div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordflow">return</span> path;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;}</div>
<div class="ttc" id="aclass_q_list_html"><div class="ttname"><a href="class_q_list.html">QList</a></div><div class="ttdef"><b>Definition:</b> <a href="qwt__abstract__legend_8h_source.html#l00017">qwt_abstract_legend.h:17</a></div></div>
<div class="ttc" id="aclass_qwt_curve_fitter_html"><div class="ttname"><a href="class_qwt_curve_fitter.html">QwtCurveFitter</a></div><div class="ttdoc">Abstract base class for a curve fitter.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__curve__fitter_8h_source.html#l00021">qwt_curve_fitter.h:22</a></div></div>
<div class="ttc" id="aclass_qwt_spline_curve_fitter_html_a3366c97cd1b28bf962d4fdbf3d75d51a"><div class="ttname"><a href="class_qwt_spline_curve_fitter.html#a3366c97cd1b28bf962d4fdbf3d75d51a">QwtSplineCurveFitter::setSpline</a></div><div class="ttdeci">void setSpline(QwtSpline *)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__spline__curve__fitter_8cpp_source.html#l00040">qwt_spline_curve_fitter.cpp:40</a></div></div>
<div class="ttc" id="aclass_qwt_spline_curve_fitter_html_a6d537e6d3aebdba0589eb2d1aa9c9154"><div class="ttname"><a href="class_qwt_spline_curve_fitter.html#a6d537e6d3aebdba0589eb2d1aa9c9154">QwtSplineCurveFitter::fitCurvePath</a></div><div class="ttdeci">virtual QPainterPath fitCurvePath(const QPolygonF &amp;) const override</div><div class="ttdef"><b>Definition:</b> <a href="qwt__spline__curve__fitter_8cpp_source.html#l00094">qwt_spline_curve_fitter.cpp:94</a></div></div>
<div class="ttc" id="aclass_qwt_spline_curve_fitter_html_a933ecbf859698978104d0dd4ec2a2f6a"><div class="ttname"><a href="class_qwt_spline_curve_fitter.html#a933ecbf859698978104d0dd4ec2a2f6a">QwtSplineCurveFitter::~QwtSplineCurveFitter</a></div><div class="ttdeci">virtual ~QwtSplineCurveFitter()</div><div class="ttdoc">Destructor.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__spline__curve__fitter_8cpp_source.html#l00026">qwt_spline_curve_fitter.cpp:26</a></div></div>
<div class="ttc" id="aclass_qwt_spline_curve_fitter_html_a98ae80240b254df85dcc44e1f3e4e830"><div class="ttname"><a href="class_qwt_spline_curve_fitter.html#a98ae80240b254df85dcc44e1f3e4e830">QwtSplineCurveFitter::QwtSplineCurveFitter</a></div><div class="ttdeci">QwtSplineCurveFitter()</div><div class="ttdoc">Constructor.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__spline__curve__fitter_8cpp_source.html#l00018">qwt_spline_curve_fitter.cpp:18</a></div></div>
<div class="ttc" id="aclass_qwt_spline_curve_fitter_html_aab51a4d6d28eb87ffd0e2878c7c32a71"><div class="ttname"><a href="class_qwt_spline_curve_fitter.html#aab51a4d6d28eb87ffd0e2878c7c32a71">QwtSplineCurveFitter::spline</a></div><div class="ttdeci">const QwtSpline * spline() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__spline__curve__fitter_8cpp_source.html#l00053">qwt_spline_curve_fitter.cpp:53</a></div></div>
<div class="ttc" id="aclass_qwt_spline_curve_fitter_html_acec7ca66398cd0e6b6e24159e9f00d3b"><div class="ttname"><a href="class_qwt_spline_curve_fitter.html#acec7ca66398cd0e6b6e24159e9f00d3b">QwtSplineCurveFitter::fitCurve</a></div><div class="ttdeci">virtual QPolygonF fitCurve(const QPolygonF &amp;) const override</div><div class="ttdef"><b>Definition:</b> <a href="qwt__spline__curve__fitter_8cpp_source.html#l00075">qwt_spline_curve_fitter.cpp:75</a></div></div>
<div class="ttc" id="aclass_qwt_spline_html"><div class="ttname"><a href="class_qwt_spline.html">QwtSpline</a></div><div class="ttdoc">Base class for all splines.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__spline_8h_source.html#l00057">qwt_spline.h:58</a></div></div>
<div class="ttc" id="aclass_qwt_spline_html_a34c5ddda039f15ec71de0523d9753b64"><div class="ttname"><a href="class_qwt_spline.html#a34c5ddda039f15ec71de0523d9753b64">QwtSpline::painterPath</a></div><div class="ttdeci">virtual QPainterPath painterPath(const QPolygonF &amp;) const =0</div></div>
<div class="ttc" id="aclass_qwt_spline_html_afb4959b1db04dd021b0a49752b66fac3"><div class="ttname"><a href="class_qwt_spline.html#afb4959b1db04dd021b0a49752b66fac3">QwtSpline::setParametrization</a></div><div class="ttdeci">void setParametrization(int type)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__spline_8cpp_source.html#l00576">qwt_spline.cpp:576</a></div></div>
<div class="ttc" id="aclass_qwt_spline_local_html"><div class="ttname"><a href="class_qwt_spline_local.html">QwtSplineLocal</a></div><div class="ttdoc">A spline with C1 continuity.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__spline__local_8h_source.html#l00024">qwt_spline_local.h:25</a></div></div>
<div class="ttc" id="aclass_qwt_spline_local_html_a1b65106f91b7cdbc7a389f3389041407ad691c00c49d088f841cb3068ba960b41"><div class="ttname"><a href="class_qwt_spline_local.html#a1b65106f91b7cdbc7a389f3389041407ad691c00c49d088f841cb3068ba960b41">QwtSplineLocal::Cardinal</a></div><div class="ttdeci">@ Cardinal</div><div class="ttdef"><b>Definition:</b> <a href="qwt__spline__local_8h_source.html#l00042">qwt_spline_local.h:42</a></div></div>
<div class="ttc" id="aclass_qwt_spline_parametrization_html_aa63256420483fa4981452127366cb48daa34d8f54e326e8964c6131287dd3e478"><div class="ttname"><a href="class_qwt_spline_parametrization.html#aa63256420483fa4981452127366cb48daa34d8f54e326e8964c6131287dd3e478">QwtSplineParametrization::ParameterUniform</a></div><div class="ttdeci">@ ParameterUniform</div><div class="ttdef"><b>Definition:</b> <a href="qwt__spline__parametrization_8h_source.html#l00072">qwt_spline_parametrization.h:72</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><b>qwt_spline_curve_fitter.cpp</b></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
